
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>配置 Watch · TypeScript Handbook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="Patrick Zhong">
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="Compiler Options in MSBuild.html" />
    
    
    <link rel="prev" href="Compiler Options.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="tutorials/">
            
                <a href="tutorials/">
            
                    
                    快速上手
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="tutorials/TypeScript in 5 minutes.html">
            
                <a href="tutorials/TypeScript in 5 minutes.html">
            
                    
                    5分钟了解TypeScript
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="tutorials/ASP.NET Core.html">
            
                <a href="tutorials/ASP.NET Core.html">
            
                    
                    ASP.NET Core
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="tutorials/ASP.NET 4.html">
            
                <a href="tutorials/ASP.NET 4.html">
            
                    
                    ASP.NET 4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="tutorials/Gulp.html">
            
                <a href="tutorials/Gulp.html">
            
                    
                    Gulp
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="tutorials/Knockout.html">
            
                <a href="tutorials/Knockout.html">
            
                    
                    Knockout.js
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="tutorials/React & Webpack.html">
            
                <a href="tutorials/React & Webpack.html">
            
                    
                    React与webpack
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="tutorials/React.html">
            
                <a href="tutorials/React.html">
            
                    
                    React
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8" data-path="tutorials/Angular 2.html">
            
                <a href="tutorials/Angular 2.html">
            
                    
                    Angular 2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9" data-path="tutorials/Migrating from JavaScript.html">
            
                <a href="tutorials/Migrating from JavaScript.html">
            
                    
                    从JavaScript迁移到TypeScript
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="./">
            
                <a href="./">
            
                    
                    手册
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="Basic Types.html">
            
                <a href="Basic Types.html">
            
                    
                    基础类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="Variable Declarations.html">
            
                <a href="Variable Declarations.html">
            
                    
                    变量声明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="Interfaces.html">
            
                <a href="Interfaces.html">
            
                    
                    接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="Classes.html">
            
                <a href="Classes.html">
            
                    
                    类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="Functions.html">
            
                <a href="Functions.html">
            
                    
                    函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="Generics.html">
            
                <a href="Generics.html">
            
                    
                    泛型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="Enums.html">
            
                <a href="Enums.html">
            
                    
                    枚举
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.8" data-path="Type Inference.html">
            
                <a href="Type Inference.html">
            
                    
                    类型推论
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.9" data-path="Type Compatibility.html">
            
                <a href="Type Compatibility.html">
            
                    
                    类型兼容性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.10" data-path="Advanced Types.html">
            
                <a href="Advanced Types.html">
            
                    
                    高级类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.11" data-path="Utilit Types.md">
            
                <span>
            
                    
                    实用工具类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.12" data-path="Symbols.html">
            
                <a href="Symbols.html">
            
                    
                    Symbols
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.13" data-path="Iterators and Generators.html">
            
                <a href="Iterators and Generators.html">
            
                    
                    Iterators 和 Generators
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.14" data-path="Modules.html">
            
                <a href="Modules.html">
            
                    
                    模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.15" data-path="Namespaces.html">
            
                <a href="Namespaces.html">
            
                    
                    命名空间
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.16" data-path="Namespaces and Modules.html">
            
                <a href="Namespaces and Modules.html">
            
                    
                    命名空间和模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.17" data-path="Module Resolution.html">
            
                <a href="Module Resolution.html">
            
                    
                    模块解析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.18" data-path="Declaration Merging.html">
            
                <a href="Declaration Merging.html">
            
                    
                    声明合并
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.19" data-path="Writing Definition Files.html">
            
                <a href="Writing Definition Files.html">
            
                    
                    书写.d.ts文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.20" data-path="JSX.html">
            
                <a href="JSX.html">
            
                    
                    JSX
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.21" data-path="Decorators.html">
            
                <a href="Decorators.html">
            
                    
                    Decorators
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.22" data-path="Mixins.html">
            
                <a href="Mixins.html">
            
                    
                    混入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.23" data-path="Triple-Slash Directives.html">
            
                <a href="Triple-Slash Directives.html">
            
                    
                    三斜线指令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.24" data-path="Type Checking JavaScript Files.html">
            
                <a href="Type Checking JavaScript Files.html">
            
                    
                    JavaScript文件里的类型检查
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="declaration files/Introduction.html">
            
                <a href="declaration files/Introduction.html">
            
                    
                    如何书写声明文件
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="declaration files/Library Structures.html">
            
                <a href="declaration files/Library Structures.html">
            
                    
                    结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="declaration files/Do's and Don'ts.html">
            
                <a href="declaration files/Do's and Don'ts.html">
            
                    
                    规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="declaration files/By Example.html">
            
                <a href="declaration files/By Example.html">
            
                    
                    举例
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="declaration files/Deep Dive.html">
            
                <a href="declaration files/Deep Dive.html">
            
                    
                    深入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="declaration files/Publishing.html">
            
                <a href="declaration files/Publishing.html">
            
                    
                    发布
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="declaration files/Consumption.html">
            
                <a href="declaration files/Consumption.html">
            
                    
                    使用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="tsconfig.json.html">
            
                <a href="tsconfig.json.html">
            
                    
                    工程配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="tsconfig.json.html">
            
                <a href="tsconfig.json.html">
            
                    
                    tsconfig.json
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="Project References.html">
            
                <a href="Project References.html">
            
                    
                    工程引用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="Typings for NPM Packages.html">
            
                <a href="Typings for NPM Packages.html">
            
                    
                    NPM包的类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="Compiler Options.html">
            
                <a href="Compiler Options.html">
            
                    
                    编译选项
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.5.5" data-path="Configuring Watch.html">
            
                <a href="Configuring Watch.html">
            
                    
                    配置 Watch
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="Compiler Options in MSBuild.html">
            
                <a href="Compiler Options in MSBuild.html">
            
                    
                    在MSBuild里使用编译选项
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.7" data-path="Integrating with Build Tools.html">
            
                <a href="Integrating with Build Tools.html">
            
                    
                    与其它构建工具整合
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8" data-path="Nightly Builds.html">
            
                <a href="Nightly Builds.html">
            
                    
                    使用TypeScript的每日构建版本
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../wiki/">
            
                <a href="../wiki/">
            
                    
                    Wiki
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../wiki/this-in-TypeScript.html">
            
                <a href="../wiki/this-in-TypeScript.html">
            
                    
                    TypeScript里的this
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../wiki/coding_guidelines.html">
            
                <a href="../wiki/coding_guidelines.html">
            
                    
                    编码规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../wiki/Common Errors.html">
            
                <a href="../wiki/Common Errors.html">
            
                    
                    常见编译错误
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../wiki/TypeScript-Editor-Support.html">
            
                <a href="../wiki/TypeScript-Editor-Support.html">
            
                    
                    支持TypeScript的编辑器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../wiki/Using-TypeScript-With-ASP.NET-5.html">
            
                <a href="../wiki/Using-TypeScript-With-ASP.NET-5.html">
            
                    
                    结合ASP.NET v5使用TypeScript
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../wiki/Architectural-Overview.html">
            
                <a href="../wiki/Architectural-Overview.html">
            
                    
                    架构概述
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../wiki/Roadmap.html">
            
                <a href="../wiki/Roadmap.html">
            
                    
                    发展路线图
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../release-notes/">
            
                <a href="../release-notes/">
            
                    
                    新增功能
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../release-notes/TypeScript 3.1.html">
            
                <a href="../release-notes/TypeScript 3.1.html">
            
                    
                    TypeScript 3.1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../release-notes/TypeScript 3.0.html">
            
                <a href="../release-notes/TypeScript 3.0.html">
            
                    
                    TypeScript 3.0
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../release-notes/TypeScript 2.9.html">
            
                <a href="../release-notes/TypeScript 2.9.html">
            
                    
                    TypeScript 2.9
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../release-notes/TypeScript 2.8.html">
            
                <a href="../release-notes/TypeScript 2.8.html">
            
                    
                    TypeScript 2.8
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="../release-notes/TypeScript 2.7.html">
            
                <a href="../release-notes/TypeScript 2.7.html">
            
                    
                    TypeScript 2.7
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6" data-path="../release-notes/TypeScript 2.6.html">
            
                <a href="../release-notes/TypeScript 2.6.html">
            
                    
                    TypeScript 2.6
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.7" data-path="../release-notes/TypeScript 2.5.html">
            
                <a href="../release-notes/TypeScript 2.5.html">
            
                    
                    TypeScript 2.5
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.8" data-path="../release-notes/TypeScript 2.4.html">
            
                <a href="../release-notes/TypeScript 2.4.html">
            
                    
                    TypeScript 2.4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.9" data-path="../release-notes/TypeScript 2.3.html">
            
                <a href="../release-notes/TypeScript 2.3.html">
            
                    
                    TypeScript 2.3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.10" data-path="../release-notes/TypeScript 2.2.html">
            
                <a href="../release-notes/TypeScript 2.2.html">
            
                    
                    TypeScript 2.2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.11" data-path="../release-notes/TypeScript 2.1.html">
            
                <a href="../release-notes/TypeScript 2.1.html">
            
                    
                    TypeScript 2.1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.12" data-path="../release-notes/TypeScript 2.0.html">
            
                <a href="../release-notes/TypeScript 2.0.html">
            
                    
                    TypeScript 2.0
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.13" data-path="../release-notes/TypeScript 1.8.html">
            
                <a href="../release-notes/TypeScript 1.8.html">
            
                    
                    TypeScript 1.8
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.14" data-path="../release-notes/TypeScript 1.7.html">
            
                <a href="../release-notes/TypeScript 1.7.html">
            
                    
                    TypeScript 1.7
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.15" data-path="../release-notes/TypeScript 1.6.html">
            
                <a href="../release-notes/TypeScript 1.6.html">
            
                    
                    TypeScript 1.6
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.16" data-path="../release-notes/TypeScript 1.5.html">
            
                <a href="../release-notes/TypeScript 1.5.html">
            
                    
                    TypeScript 1.5
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.17" data-path="../release-notes/TypeScript 1.4.html">
            
                <a href="../release-notes/TypeScript 1.4.html">
            
                    
                    TypeScript 1.4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.18" data-path="../release-notes/TypeScript 1.3.html">
            
                <a href="../release-notes/TypeScript 1.3.html">
            
                    
                    TypeScript 1.3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.19" data-path="../release-notes/TypeScript 1.1.html">
            
                <a href="../release-notes/TypeScript 1.1.html">
            
                    
                    TypeScript 1.1
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../breaking-changes/breaking-changes.html">
            
                <a href="../breaking-changes/breaking-changes.html">
            
                    
                    Breaking Changes
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../breaking-changes/TypeScript 2.4.html">
            
                <a href="../breaking-changes/TypeScript 2.4.html">
            
                    
                    TypeScript 2.4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../breaking-changes/TypeScript 2.3.html">
            
                <a href="../breaking-changes/TypeScript 2.3.html">
            
                    
                    TypeScript 2.3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../breaking-changes/TypeScript 2.2.html">
            
                <a href="../breaking-changes/TypeScript 2.2.html">
            
                    
                    TypeScript 2.2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../breaking-changes/TypeScript 2.1.html">
            
                <a href="../breaking-changes/TypeScript 2.1.html">
            
                    
                    TypeScript 2.1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.5" data-path="../breaking-changes/TypeScript 2.0.html">
            
                <a href="../breaking-changes/TypeScript 2.0.html">
            
                    
                    TypeScript 2.0
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.6" data-path="../breaking-changes/TypeScript 1.8.html">
            
                <a href="../breaking-changes/TypeScript 1.8.html">
            
                    
                    TypeScript 1.8
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.7" data-path="../breaking-changes/TypeScript 1.7.html">
            
                <a href="../breaking-changes/TypeScript 1.7.html">
            
                    
                    TypeScript 1.7
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.8" data-path="../breaking-changes/TypeScript 1.6.html">
            
                <a href="../breaking-changes/TypeScript 1.6.html">
            
                    
                    TypeScript 1.6
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.9" data-path="../breaking-changes/TypeScript 1.5.html">
            
                <a href="../breaking-changes/TypeScript 1.5.html">
            
                    
                    TypeScript 1.5
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.10" data-path="../breaking-changes/TypeScript 1.4.html">
            
                <a href="../breaking-changes/TypeScript 1.4.html">
            
                    
                    TypeScript 1.4
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >配置 Watch</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <p>&#x7F16;&#x8BD1;&#x5668;&#x652F;&#x6301;&#x4F7F;&#x7528;&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x914D;&#x7F6E;&#x5982;&#x4F55;&#x76D1;&#x89C6;&#x6587;&#x4EF6;&#x548C;&#x76EE;&#x5F55;&#x7684;&#x53D8;&#x5316;&#x3002;</p>
<h2 id="&#x4F7F;&#x7528;tscwatchfile&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x6765;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x76D1;&#x89C6;">&#x4F7F;&#x7528;<code>TSC_WATCHFILE</code>&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x6765;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x76D1;&#x89C6;</h2>
<table>
<thead>
<tr>
<th>&#x9009;&#x9879;</th>
<th>&#x63CF;&#x8FF0;</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>PriorityPollingInterval</code></td>
<td>&#x4F7F;&#x7528;<code>fs.watchFile</code>&#x4F46;&#x9488;&#x5BF9;&#x6E90;&#x7801;&#x6587;&#x4EF6;&#xFF0C;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x548C;&#x6D88;&#x5931;&#x7684;&#x6587;&#x4EF6;&#x4F7F;&#x7528;&#x4E0D;&#x540C;&#x7684;&#x8F6E;&#x8BE2;&#x95F4;&#x9694;</td>
</tr>
<tr>
<td><code>DynamicPriorityPolling</code></td>
<td>&#x4F7F;&#x7528;&#x52A8;&#x6001;&#x961F;&#x5217;&#xFF0C;&#x5BF9;&#x7ECF;&#x5E38;&#x88AB;&#x4FEE;&#x6539;&#x7684;&#x6587;&#x4EF6;&#x4F7F;&#x7528;&#x8F83;&#x77ED;&#x7684;&#x8F6E;&#x8BE2;&#x95F4;&#x9694;&#xFF0C;&#x5BF9;&#x672A;&#x4FEE;&#x6539;&#x7684;&#x6587;&#x4EF6;&#x4F7F;&#x7528;&#x8F83;&#x957F;&#x7684;&#x8F6E;&#x8BE2;&#x95F4;&#x9694;</td>
</tr>
<tr>
<td><code>UseFsEvents</code></td>
<td>&#x4F7F;&#x7528; <code>fs.watch</code>&#xFF0C;&#x5B83;&#x4F7F;&#x7528;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x4E8B;&#x4EF6;&#xFF08;&#x4F46;&#x5728;&#x4E0D;&#x540C;&#x7684;&#x7CFB;&#x7EDF;&#x4E0A;&#x53EF;&#x80FD;&#x4E0D;&#x4E00;&#x5B9A;&#x51C6;&#x786E;&#xFF09;&#x6765;&#x67E5;&#x8BE2;&#x6587;&#x4EF6;&#x7684;&#x4FEE;&#x6539;/&#x521B;&#x5EFA;/&#x5220;&#x9664;&#x3002;&#x6CE8;&#x610F;&#x5C11;&#x6570;&#x7684;&#x7CFB;&#x7EDF;&#x5982;Linux&#xFF0C;&#x5BF9;&#x76D1;&#x89C6;&#x8005;&#x7684;&#x6570;&#x91CF;&#x6709;&#x9650;&#x5236;&#xFF0C;&#x5982;&#x679C;&#x4F7F;&#x7528;<code>fs.watch</code>&#x521B;&#x5EFA;&#x76D1;&#x89C6;&#x5931;&#x8D25;&#x90A3;&#x4E48;&#x5C06;&#x901A;&#x8FC7;<code>fs.watchFile</code>&#x6765;&#x521B;&#x5EFA;&#x76D1;&#x89C6;</td>
</tr>
<tr>
<td><code>UseFsEventsWithFallbackDynamicPolling</code></td>
<td>&#x6B64;&#x9009;&#x9879;&#x4E0E;<code>UseFsEvents</code>&#x7C7B;&#x4F3C;&#xFF0C;&#x53EA;&#x4E0D;&#x8FC7;&#x5F53;&#x4F7F;&#x7528;<code>fs.watch</code>&#x521B;&#x5EFA;&#x76D1;&#x89C6;&#x5931;&#x8D25;&#x540E;&#xFF0C;&#x56DE;&#x9000;&#x5230;&#x4F7F;&#x7528;&#x52A8;&#x6001;&#x8F6E;&#x8BE2;&#x961F;&#x5217;&#x8FDB;&#x884C;&#x76D1;&#x89C6;&#xFF08;&#x5982;<code>DynamicPriorityPolling</code>&#x4ECB;&#x7ECD;&#x7684;&#x90A3;&#x6837;&#xFF09;</td>
</tr>
<tr>
<td><code>UseFsEventsOnParentDirectory</code></td>
<td>&#x6B64;&#x9009;&#x9879;&#x901A;&#x8FC7;<code>fs.watch</code>&#xFF08;&#x4F7F;&#x7528;&#x7CFB;&#x7EDF;&#x6587;&#x4EF6;&#x4E8B;&#x4EF6;&#xFF09;&#x76D1;&#x89C6;&#x6587;&#x4EF6;&#x7684;&#x7236;&#x76EE;&#x5F55;&#xFF0C;&#x56E0;&#x6B64;CPU&#x5360;&#x7528;&#x7387;&#x4F4E;&#x4F46;&#x4E5F;&#x4F1A;&#x964D;&#x4F4E;&#x7CBE;&#x5EA6;</td>
</tr>
<tr>
<td>&#x9ED8;&#x8BA4; &#xFF08;&#x65E0;&#x6307;&#x5B9A;&#x503C;&#xFF09;</td>
<td>&#x5982;&#x679C;&#x73AF;&#x5883;&#x53D8;&#x91CF;<code>TSC_NONPOLLING_WATCHER</code>&#x8BBE;&#x7F6E;&#x4E3A;<code>true</code>&#xFF0C;&#x76D1;&#x89C6;&#x6587;&#x4EF6;&#x7684;&#x7236;&#x76EE;&#x5F55;&#xFF08;&#x5982;&#x540C;<code>UseFsEventsOnParentDirectory</code>&#xFF09;&#x3002;&#x5426;&#x5219;&#xFF0C;&#x4F7F;&#x7528;<code>fs.watchFile</code>&#x76D1;&#x89C6;&#x6587;&#x4EF6;&#xFF0C;&#x8D85;&#x65F6;&#x65F6;&#x95F4;&#x4E3A;<code>250ms</code>&#x3002;</td>
</tr>
</tbody>
</table>
<h2 id="&#x4F7F;&#x7528;tscwatchdirectory&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x6765;&#x914D;&#x7F6E;&#x76EE;&#x5F55;&#x76D1;&#x89C6;">&#x4F7F;&#x7528;<code>TSC_WATCHDIRECTORY</code>&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x6765;&#x914D;&#x7F6E;&#x76EE;&#x5F55;&#x76D1;&#x89C6;</h2>
<p>&#x5728;&#x90A3;&#x4E9B;Nodejs&#x539F;&#x751F;&#x5C31;&#x4E0D;&#x652F;&#x6301;&#x9012;&#x5F52;&#x76D1;&#x89C6;&#x76EE;&#x5F55;&#x7684;&#x5E73;&#x53F0;&#x4E0A;&#xFF0C;&#x6211;&#x4EEC;&#x4F1A;&#x6839;&#x636E;<code>TSC_WATCHDIRECTORY</code>&#x7684;&#x4E0D;&#x540C;&#x9009;&#x9879;&#x9012;&#x5F52;&#x5730;&#x521B;&#x5EFA;&#x5BF9;&#x5B50;&#x76EE;&#x5F55;&#x7684;&#x76D1;&#x89C6;&#x3002; &#x6CE8;&#x610F;&#x5728;&#x90A3;&#x4E9B;&#x539F;&#x751F;&#x5C31;&#x652F;&#x6301;&#x9012;&#x5F52;&#x76D1;&#x89C6;&#x76EE;&#x5F55;&#x7684;&#x5E73;&#x53F0;&#x4E0A;&#xFF08;&#x5982;Windows&#xFF09;&#xFF0C;&#x8FD9;&#x4E2A;&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x4F1A;&#x88AB;&#x5FFD;&#x7565;&#x3002;</p>
<table>
<thead>
<tr>
<th>&#x9009;&#x9879;</th>
<th>&#x63CF;&#x8FF0;</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>RecursiveDirectoryUsingFsWatchFile</code></td>
<td>&#x4F7F;&#x7528;<code>fs.watchFile</code>&#x76D1;&#x89C6;&#x76EE;&#x5F55;&#x548C;&#x5B50;&#x76EE;&#x5F55;&#xFF0C;&#x5B83;&#x662F;&#x4E00;&#x4E2A;&#x8F6E;&#x8BE2;&#x76D1;&#x89C6;&#xFF08;&#x6D88;&#x8017;CPU&#x5468;&#x671F;&#xFF09;</td>
</tr>
<tr>
<td><code>RecursiveDirectoryUsingDynamicPriorityPolling</code></td>
<td>&#x4F7F;&#x7528;&#x52A8;&#x6001;&#x8F6E;&#x8BE2;&#x961F;&#x5217;&#x6765;&#x83B7;&#x53D6;&#x76EE;&#x5F55;&#x4E0E;&#x5176;&#x5B50;&#x76EE;&#x5F55;&#x7684;&#x6539;&#x53D8;</td>
</tr>
<tr>
<td>&#x9ED8;&#x8BA4; &#xFF08;&#x65E0;&#x6307;&#x5B9A;&#x503C;&#xFF09;</td>
<td>&#x4F7F;&#x7528;<code>fs.watch</code>&#x6765;&#x76D1;&#x89C6;&#x76EE;&#x5F55;&#x53CA;&#x5176;&#x5B50;&#x76EE;&#x5F55;</td>
</tr>
</tbody>
</table>
<h2 id="&#x80CC;&#x666F;">&#x80CC;&#x666F;</h2>
<p>&#x5728;&#x7F16;&#x8BD1;&#x5668;&#x4E2D;<code>--watch</code>&#x7684;&#x5B9E;&#x73B0;&#x4F9D;&#x8D56;&#x4E8E;Nodejs&#x63D0;&#x4F9B;&#x7684;<code>fs.watch</code>&#x548C;<code>fs.watchFile</code>&#xFF0C;&#x4E24;&#x8005;&#x5404;&#x6709;&#x4F18;&#x7F3A;&#x70B9;&#x3002;</p>
<p><code>fs.watch</code>&#x4F7F;&#x7528;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x4E8B;&#x4EF6;&#x901A;&#x77E5;&#x6587;&#x4EF6;&#x53CA;&#x76EE;&#x5F55;&#x7684;&#x53D8;&#x5316;&#x3002;
&#x4F46;&#x662F;&#x5B83;&#x4F9D;&#x8D56;&#x4E8E;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#xFF0C;&#x4E14;&#x4E8B;&#x4EF6;&#x901A;&#x77E5;&#x5E76;&#x4E0D;&#x5B8C;&#x5168;&#x53EF;&#x9760;&#xFF0C;&#x5728;&#x5F88;&#x591A;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x4E0A;&#x7684;&#x884C;&#x4E3A;&#x96BE;&#x4EE5;&#x9884;&#x6599;&#x3002;
&#x8FD8;&#x53EF;&#x80FD;&#x4F1A;&#x6709;&#x521B;&#x5EFA;&#x76D1;&#x89C6;&#x4E2A;&#x6570;&#x7684;&#x9650;&#x5236;&#xFF0C;&#x5982;Linux&#x7CFB;&#x7EDF;&#xFF0C;&#x5728;&#x5305;&#x542B;&#x5927;&#x91CF;&#x6587;&#x4EF6;&#x7684;&#x7A0B;&#x5E8F;&#x4E2D;&#x76D1;&#x89C6;&#x5668;&#x4E2A;&#x6570;&#x5F88;&#x5FEB;&#x88AB;&#x8017;&#x5C3D;&#x3002;
&#x4F46;&#x4E5F;&#x6B63;&#x662F;&#x56E0;&#x4E3A;&#x5B83;&#x4F7F;&#x7528;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x4E8B;&#x4EF6;&#xFF0C;&#x4E0D;&#x9700;&#x8981;&#x5360;&#x7528;&#x8FC7;&#x591A;&#x7684;CPU&#x5468;&#x671F;&#x3002;
&#x5178;&#x578B;&#x5730;&#xFF0C;&#x7F16;&#x8BD1;&#x5668;&#x4F7F;&#x7528;<code>fs.watch</code>&#x6765;&#x76D1;&#x89C6;&#x76EE;&#x5F55;&#xFF08;&#x6BD4;&#x5982;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x91CC;&#x58F0;&#x660E;&#x7684;&#x6E90;&#x7801;&#x76EE;&#x5F55;&#xFF0C;&#x65E0;&#x6CD5;&#x8FDB;&#x884C;&#x6A21;&#x5757;&#x89E3;&#x6790;&#x7684;&#x76EE;&#x5F55;&#xFF09;&#x3002;
&#x8FD9;&#x6837;&#x5C31;&#x53EF;&#x4EE5;&#x5904;&#x7406;&#x6539;&#x52A8;&#x901A;&#x77E5;&#x4E0D;&#x51C6;&#x786E;&#x7684;&#x95EE;&#x9898;&#x3002;
&#x4F46;&#x9012;&#x5F52;&#x5730;&#x76D1;&#x89C6;&#x4EC5;&#x5728;Windows&#x548C;OSX&#x7CFB;&#x7EDF;&#x4E0A;&#x652F;&#x6301;&#x3002;
&#x8FD9;&#x5C31;&#x610F;&#x5473;&#x7740;&#x5728;&#x5176;&#x5B83;&#x7CFB;&#x7EDF;&#x4E0A;&#x8981;&#x4F7F;&#x7528;&#x66FF;&#x4EE3;&#x65B9;&#x6848;&#x3002;</p>
<p><code>fs.watchFile</code>&#x4F7F;&#x7528;&#x8F6E;&#x8BE2;&#xFF0C;&#x56E0;&#x6B64;&#x6D89;&#x53CA;&#x5230;CPU&#x5468;&#x671F;&#x3002;
&#x4F46;&#x662F;&#x8FD9;&#x662F;&#x6700;&#x53EF;&#x9760;&#x7684;&#x83B7;&#x53D6;&#x6587;&#x4EF6;/&#x76EE;&#x5F55;&#x72B6;&#x6001;&#x7684;&#x673A;&#x5236;&#x3002;
&#x5178;&#x578B;&#x5730;&#xFF0C;&#x7F16;&#x8BD1;&#x5668;&#x4F7F;&#x7528;<code>fs.watchFile</code>&#x76D1;&#x89C6;&#x6E90;&#x6587;&#x4EF6;&#xFF0C;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x548C;&#x6D88;&#x5931;&#x7684;&#x6587;&#x4EF6;&#xFF08;&#x5931;&#x53BB;&#x6587;&#x4EF6;&#x5F15;&#x7528;&#xFF09;&#xFF0C;&#x8FD9;&#x610F;&#x5473;&#x7740;&#x5BF9;CPU&#x7684;&#x4F7F;&#x7528;&#x4F9D;&#x8D56;&#x4E8E;&#x7A0B;&#x5E8F;&#x91CC;&#x6587;&#x4EF6;&#x7684;&#x6570;&#x91CF;&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="Compiler Options.html" class="navigation navigation-prev " aria-label="Previous page: 编译选项">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="Compiler Options in MSBuild.html" class="navigation navigation-next " aria-label="Next page: 在MSBuild里使用编译选项">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"配置 Watch","level":"1.5.5","depth":2,"next":{"title":"在MSBuild里使用编译选项","level":"1.5.6","depth":2,"path":"doc/handbook/Compiler Options in MSBuild.md","ref":"./doc/handbook/Compiler Options in MSBuild.md","articles":[]},"previous":{"title":"编译选项","level":"1.5.4","depth":2,"path":"doc/handbook/Compiler Options.md","ref":"./doc/handbook/Compiler Options.md","articles":[]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"Patrick Zhong","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"preface.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"TypeScript Handbook","language":"zh-hans","gitbook":">3.0.0","description":"Translation of official TypeScript Handbook"},"file":{"path":"doc/handbook/Configuring Watch.md","mtime":"2018-10-13T09:48:54.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-13T09:57:42.904Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

